﻿using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Windows;
using System.Windows.Controls;

namespace Waaahsabi.Controls.TheGame
{
	public class GenericFeatureList : Control
	{
		#region Title DependencyProperty
		public static readonly DependencyProperty TitleProperty =
		DependencyProperty.Register
			(
			"Title",
			typeof(string),
			typeof(GenericFeatureList),
			new PropertyMetadata("Title not initialized")
			);

		public string Title
		{
			get { return (string)GetValue(TitleProperty); }
			set { SetValue(TitleProperty, value); }
		}
		#endregion

		#region Description DependencyProperty
		public static readonly DependencyProperty DescriptionProperty =
		DependencyProperty.Register
			(
			"Description",
			typeof(string),
			typeof(GenericFeatureList),
			new PropertyMetadata("Feature list description not set")
			);

		public string Description
		{
			get { return (string)GetValue(DescriptionProperty); }
			set { SetValue(DescriptionProperty, value); }
		}
		#endregion

		#region Items DependencyProperty
		public static readonly DependencyProperty ItemsProperty =
		DependencyProperty.Register
			(
			"Items",
			typeof(ObservableCollection<GenericSelectorButton>),
			typeof(GenericFeatureList),
			new PropertyMetadata(new ObservableCollection<GenericSelectorButton>())
			);

		public ObservableCollection<GenericSelectorButton> Items
		{
			get { return (ObservableCollection<GenericSelectorButton>)GetValue(ItemsProperty); }
			set { SetValue(ItemsProperty, value); }
		}
		#endregion

#pragma warning disable 67
		public event EventHandler<FeatureEventArgs> ItemClicked;
#pragma warning restore 67

		public GenericFeatureList()
		{
			DefaultStyleKey = typeof(GenericFeatureList);
			Items.CollectionChanged += Items_CollectionChanged;
		}

		void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
		{
		}
	}

	public class FeatureEventArgs : EventArgs
	{
		public ulong InterfaceId { get; set; } //interface id
		public string FeatureName { get; set; }
		public ulong FeatureId { get; set; }
	}
}
